﻿<!-- 
 Family Lines code is provided using the Apache License V2.0, January 2004 http://www.apache.org/licenses/
 -->
<UserControl x:Class="KBS.FamilyLines.Controls.HeaderEditor"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:Properties="clr-namespace:KBS.FamilyLines.Properties"
             >

    <!-- NOTE: maxlength values for Textboxes are as required by the GEDCOM standard -->
    
        <StackPanel>

            <Border Padding="5,0,5,0" Background="{DynamicResource BackgroundBrush}" 
                BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1,1,1,0" 
                CornerRadius="5,5,0,0" Height="30">

            <TextBlock Padding="5,0,0,0" Text="{x:Static Properties:Resources.EditHeaderData}" 
                       TextWrapping="Wrap" Foreground="{DynamicResource HeaderFontColor}" 
                       FontSize="18" FontWeight="Bold" VerticalAlignment="Center" 
                       HorizontalAlignment="Left"/>
            </Border>

        <Border BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1,1,1,1">
            <StackPanel Margin="0" 
                        HorizontalAlignment="Stretch"
                        Background="{DynamicResource InputBackgroundBrush}"
                        >

                <Grid Margin="7">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="250"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="7"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>

                    <Label Foreground="{DynamicResource InputFontColor}" 
                           Grid.Row="0"
                           Grid.Column="0"
                           Padding="0"
                           Margin="5,0,5,0"
                           FontWeight="Bold"
                           Content="{x:Static Properties:Resources.Submitter}"/>
                    
                    <Label Foreground="{DynamicResource InputFontColor}" 
                           Grid.Row="1"
                           Grid.Column="0"
                           Padding="0"
                           Margin="5,0,5,0"
                           HorizontalAlignment="Right"
                           VerticalAlignment="Center"
                           Content="{x:Static Properties:Resources.Name}"/>
                    <TextBox Grid.Row="1"
                             Grid.Column="1"
                             MaxLength="60"
                             Margin="3"
                             Text="{Binding Mode=TwoWay, Path=SubmitterName}"/>
                    
                    <Label Foreground="{DynamicResource InputFontColor}" 
                           Grid.Row="2"
                           Grid.Column="0"
                           Padding="0"
                           Margin="5,0,5,0"
                           HorizontalAlignment="Right"
                           VerticalAlignment="Center"
                           Content="{x:Static Properties:Resources.Address1}"/>
                    <TextBox Grid.Row="2"
                             Grid.Column="1"
                             MaxLength="60"
                             Margin="3"
                             Text="{Binding Path=Address1}"/>
                    
                    <Label Foreground="{DynamicResource InputFontColor}" 
                           Grid.Row="3"
                           Grid.Column="0"
                           Padding="0"
                           Margin="5,0,5,0"
                           HorizontalAlignment="Right"
                           VerticalAlignment="Center"
                           Content="{x:Static Properties:Resources.Address2}"/>
                    <TextBox Grid.Row="3"
                             Grid.Column="1"
                             MaxLength="60"
                             Margin="3"
                             Text="{Binding Path=Address2}"/>

                    <Label Foreground="{DynamicResource InputFontColor}" 
                           Grid.Row="4"
                           Grid.Column="0"
                           Padding="0"
                           Margin="5,0,5,0"
                           HorizontalAlignment="Right"
                           VerticalAlignment="Center"
                           Content="{x:Static Properties:Resources.Phone}"/>
                    <TextBox Grid.Row="4"
                             Grid.Column="1"
                             MaxLength="25"
                             Width="150"
                             HorizontalAlignment="Left"
                             Margin="3"
                             Text="{Binding Path=Phone}"/>
                    
                    <Label Foreground="{DynamicResource InputFontColor}" 
                           Grid.Row="5"
                           Grid.Column="0"
                           Padding="0"
                           Margin="5,0,5,0"
                           HorizontalAlignment="Right"
                           VerticalAlignment="Center"
                           Content="{x:Static Properties:Resources.LanguageHeader}"/>
                    <TextBox Grid.Row="5"
                             Grid.Column="1"
                             MaxLength="90"
                             Margin="3"
                             Text="{Binding Mode=TwoWay, Path=Lang}"/>
                    
                    <Label Foreground="{DynamicResource InputFontColor}" 
                           Grid.Row="6"
                           Grid.Column="0"
                           Padding="0"
                           Margin="5,0,5,0"
                           HorizontalAlignment="Right"
                           VerticalAlignment="Center"
                           Content="{x:Static Properties:Resources.RegisteredRFN}"/>
                    <TextBox Grid.Row="6"
                             Grid.Column="1"
                             MaxLength="30"
                             Width="150"
                             Margin="3"
                             HorizontalAlignment="Left"
                             Text="{Binding Mode=TwoWay, Path=RFN}"/>

                    <Label Foreground="{DynamicResource InputFontColor}" 
                           Grid.Row="8"
                           Grid.Column="0"
                           Padding="0"
                           Margin="5,0,5,0"
                           HorizontalAlignment="Right"
                           VerticalAlignment="Center"
                           Content="{x:Static Properties:Resources.CopyrightLabel}"/>
                    <TextBox Grid.Row="8"
                             Grid.Column="1"
                             MaxLength="90"
                             Margin="3"
                             Text="{Binding Mode=TwoWay, Path=Copr}"/>

                </Grid>

                <StackPanel Orientation="Horizontal" Margin="5" HorizontalAlignment="Center">
                    <Button Margin="0,0,6,0" x:Name="Save" Click="Save_Click" Content="{x:Static Properties:Resources.Save}"/>
                    <Button Margin="6,0,0,0" x:Name="Close" Click="Close_Click" Content="{x:Static Properties:Resources.Close}"/>
                </StackPanel>
            </StackPanel>

        </Border>

        <!-- Footer -->
        <Grid>
            <Border Background="{DynamicResource BackgroundBrush}" Height="15" 
                    BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1,0,1,1" 
                    CornerRadius="0,0,5,5"/>
        </Grid>

    </StackPanel>
</UserControl>
